<template>
  <div class="station-query">
    <yd-search v-model="value1" :on-submit="submitHandler" placeholder="请输入员工姓名或者工位查询"></yd-search>
    <div class="search-result">
      <div v-for="(item,index) in data" :key="index">
        <router-link to="/station-info">
          <yd-cell-item arrow class="item">
            <span slot="left">
              <span class="name">张三</span>
              <span class="department">产品规划部</span>
            </span>
            <span slot="right">
              <img src="../../assets/icon/select.png"> 4D-001
            </span>
          </yd-cell-item>
        </router-link>
      </div>
      <div class="none" v-show="data && data.length === 0">
        <img src="../../assets/icon/none.png">
        <p>没有查到相关信息</p>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'StationQuery',
  data() {
    return {
      value1: '',
      data: null
    }
  },
  methods: {
    submitHandler(value) {
      // this.$dialog.toast({ mes: `搜索：${value}` })
      console.log(value)
      setTimeout(() => {
        this.data = []
        for (let i = 0; i < 5; i++) {
          this.data.push(i)
        }
      }, 500)
    }
  }
}
</script>
<style lang="stylus" scoped>
@import '~styles/varibles.styl';
.station-query
  >>>.yd-search-input
    background: $blue;
    padding: 0.16rem 0.2rem;
    .cancel-text
      display: none;
    .search-input
      border-radius: 0.32rem !important;
      height: auto;
      padding-top: 0;
      margin-right: 0;
    .search-icon:after
      color: #C4C4C4;
      font-size: 0.32rem;
    .yd-input>input
      height: 0.64rem;
      line-height: 0.64rem;
      font-size: 0.28rem;
      color: $darkText;
      &::-webkit-input-placeholder
        color: #C4C4C4;
  .item
    margin-bottom: 1px;
    background: $white;
    padding-left: 0.34rem;
    height: 1.5rem;
    >>>.yd-cell-left, >>>.yd-cell-right
      color: $darkText !important;
    >>>.yd-cell-left, >>>.yd-cell-left span
      display: block;
    >>>.yd-cell-left
      padding-top: 0.28rem;
    .name
      line-height: 0.48rem;
      font-size: 0.34rem;
      margin-bottom: 0.1rem;
    .department
      line-height: 0.36rem;
      font-size: 0.26rem;
    >>>.yd-cell-right
      img
        width: 0.48rem;
        height: 0.48rem;
      span
        line-height: 0.5rem;
        margin-right: 0.3rem;
    >>>.yd-cell-arrow:after
      color: #7B7A7A;
  .none
    padding-top: 2.88rem;
    img
      width: 2.06rem;
      height: 1.92rem;
      display: block;
      margin: 0 auto 0.76rem;
      position: relative;
      left: 0.3rem;
    p
      color: #C4C4C4;
      font-size: 0.3rem;
      line-height: 0.42rem;
      text-align: center;
</style>
